package com.example.myivideo.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentStatePagerAdapter
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.example.home.ui.HomeFragment

class HomeViewPagerAdapter(fragment: FragmentActivity,_fragments:List<Fragment>?):
    FragmentStateAdapter(fragment){

    var fragments:List<Fragment>? = null

    init {
        this.fragments = _fragments
    }

//    override fun getCount(): Int {
//        return fragments!!.size
//    }
//
//    override fun getItem(position: Int): Fragment {
//        return fragments!![position]
//    }

    override fun getItemCount(): Int {
        return fragments!!.size
    }

    override fun createFragment(position: Int): Fragment {
        return fragments!![position]
    }


}